numpy get index of n largest values

37

numbers = np.array([1, 3, 2, 4])
n = 2
indices = (-numbers).argsort()[:n]

Comments

Submit
0 Comments